package com.borko.healthcare.tapestry.components;

import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.services.Cookies;

import com.borko.healthcare.tapestry.pages.Login;

public class Layout {
	
	@Inject
	private Cookies cookies;
	
	public Object onActivate() {
		System.out.println(cookies.readCookieValue("isUserLoged"));
		if (cookies.readCookieValue("isUserLoged").equalsIgnoreCase("false") 
				|| cookies.readCookieValue("isUserLoged") == null) {
			return Login.class;
		}
		return null;
	}

}
